/*
 *	This file is part of Lounge-Cast.
 *
 *  Author:  	Markus Moormann
 *	E-mail:  	mmoorman@uni-osnabrueck.de
 *	Copyright:	University of Osnabrueck (Zentrum Virtuos)
 * 	Website:	www.uni-osnabrueck.de
 *	Date:		16.02.2011
 *
 *	Lounge-Cast is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *	Lounge-Cast is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Lounge-Cast.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.osmf.elements
{
	import multimedia.model.vo.SlideVO;
	
	import mx.collections.ArrayCollection;
	
	import org.osmf.media.URLResource;
	import org.osmf.traits.LoadTrait;
	import org.osmf.traits.MediaTraitType;

	/**
	 * class representing a SlideElement extending the OSMF class
	 * <code>SerialElement</code> so that all SWFElements can be seen 
	 * in sequence
	 * @see SerialElement
	 */
	public class SlideElement extends SerialElement
	{
		/**
		 * construtor for creating all SWFElements
		 * 
		 * @param slide the <code>SlideVO</code> containing all information about the slide
		 */
		public function SlideElement(slide:SlideVO)
		{
			for(var i:Number = 1; i <= slide.slideSteps.length; i++)
			{
				var swf:SWFElement = new SWFElement(new URLResource(slide.url + "/assets/Slide" + i + ".swf"));
				(swf.getTrait(MediaTraitType.LOAD) as LoadTrait).load();
				addChild(new DurationElement(2, swf));
			}
		}
	}
}